package com.jusu.dao;

import org.apache.ibatis.session.SqlSession;

import com.jusu.entity.User;
import com.jusu.util.MyBatisUtil;

public class UserDaoImpl implements IUserDao {

	@Override
	public User findUserName(String userName) {
		SqlSession session = MyBatisUtil.getSession();
		User user = session.selectOne("com.jusu.dao.IUserDao.findUserName", userName);
		MyBatisUtil.closeSession(session);
		return user;
	}

	
	public int insertUser(User user) {
		SqlSession session = MyBatisUtil.getSession();
		int flag = session.insert("com.jusu.dao.IUserDao.insertUser",user);
		MyBatisUtil.closeSession(session);
		return flag;
	}

}
